solve the linear equations